home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_0799 / 704 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  1.5 KB

  1. From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
  2. Date: Wed, 15 Dec 93 11:10:27 +0100
  3. Message-Id: <9312151010.AA18543@issan.informatik.uni-dortmund.de>
  4. To: mint@atari.archive.umich.edu
  5. Subject: MiNT 1.09: Busy wait on console input
  6.  
  7. MiNT currently consumes too much cpu time for processes waiting on
  8. console input, even if the patch (sorry, i forget by whom) is applied
  9. that replaces yield() by nap(60).  (The latter has the disadvantage
  10. that it generates many debug messages from kmalloc/kfree when
  11. debug_level is set to LOW_LEVEL.)  But the console is a very slow
  12. device on the read side.  Since it is interrupt driven, it is easy to
  13. change this to use sleep().  Once select() works on the other bios
  14. devices we can change that too.
  15.  
  16. --- orig/bios.c    Tue Jul 27 19:51:48 1993
  17. +++ bios.c    Tue Dec 14 20:30:52 1993
  18. @@ -37,6 +37,8 @@
  19.  
  20.  char *kbshft;        /* set in main.c */
  21.  
  22. +short console_in;    /* wait condition for console input */
  23. +
  24.  /* some BIOS vectors; note that the routines at these vectors may do nasty
  25.   * things to registers!
  26.   */
  27. @@ -165,7 +167,7 @@
  28.          k = keyrec;
  29.  again:
  30.          while (k->tail == k->head) {
  31. -            yield();
  32. +            sleep (IO_Q, (long) &console_in);
  33.          }
  34.  
  35.          if (checkkeys()) goto again;
  36. @@ -811,6 +811,10 @@
  37.  /* has someone done select() on the keyboard?? */
  38.      if (tty->rsel && keyrec->head != keyrec->tail)
  39.          wakeselect(tty->rsel);
  40. +
  41. +    /* wake up any processes waiting in bconin() */
  42. +    if (keyrec->head != keyrec->tail)
  43. +      wake (IO_Q, (long) &console_in);
  44.  
  45.      return ret;
  46.  }
  47.